/*
 * Application Name: 工作票信息管理系统
 * Desc: 系统中所有使用到的store类都集中在这里定义，相当于封装的hibernate数据访问方法
 * Author: Albert 
 * Date: 2009-07-22
 */
Ext.namespace('workpaper.store');

/*################# 工作票办理(起始) ###############################################################################################*/
Ext.namespace('workpaper.store.dealPaper');

/******************待办工作票列表对应的store*****************************************************************************************/
workpaper.store.dealPaper.waitingStore = function(){
    workpaper.store.dealPaper.waitingStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/dealPaper/waitingPaper.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'paperId'
        }, [
	        {name: 'paperId'},
	        {name: 'waitingType'},
	        {name: 'paperType'},
	        {name: 'paperStatus'},
	        {name: 'planTime'},
	        {name: 'principal'},
	        {name: 'arriveTime'},
	        {name: 'workDept'},
	        {name: 'transactor'}                    
	       ]
        )
    });

    //this.setDefaultSort('arriveTime', 'desc');
};
Ext.extend(workpaper.store.dealPaper.waitingStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});


/******************工作票草稿列表对应的store*****************************************************************************************/
workpaper.store.dealPaper.draftStore = function(){
    workpaper.store.dealPaper.draftStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/dealPaper/draftPaper.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'paperId'
        }, [
	        {name: 'paperId'},
	        {name: 'paperType'},
	        {name: 'paperStatus'},	        	        
	        {name: 'planTime'},
	        {name: 'principal'},
	        {name: 'creator'},
	        {name: 'createTime'},
	        {name: 'workDept'},
	        {name: 'workUnit'}                    
	       ]
        )
    });

    //this.setDefaultSort('arriveTime', 'desc');
};
Ext.extend(workpaper.store.dealPaper.draftStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});


/******************热力机械工作票对应的store*****************************************************************************************/
workpaper.store.dealPaper.rljxGridFirstStore = function(){
    workpaper.store.dealPaper.rljxGridFirstStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/dealPaper/rljx/grid01.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'id'
        }, [
	        {name: 'id'},
	        {name: 'col1'},	       
	        {name: 'col2'}                    
	       ]
        )
    }); 
};
Ext.extend(workpaper.store.dealPaper.rljxGridFirstStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});
/*****************************************************************************************************************************/
workpaper.store.dealPaper.rljxGridSecondStore = function(){
    workpaper.store.dealPaper.rljxGridSecondStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/dealPaper/rljx/grid02.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'id'
        }, [
	        {name: 'id'},
	        {name: 'col1'},
	        {name: 'col2'},	       
	        {name: 'col3'}                    
	       ]
        )
    }); 
};
Ext.extend(workpaper.store.dealPaper.rljxGridSecondStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});
/*****************************************************************************************************************************/
workpaper.store.dealPaper.rljxGridThirdStore = function(){
    workpaper.store.dealPaper.rljxGridThirdStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/dealPaper/rljx/grid03.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'id'
        }, [
	        {name: 'id'},
	        {name: 'col1'},
	        {name: 'col2'}
	       ]
        )
    }); 
};
Ext.extend(workpaper.store.dealPaper.rljxGridThirdStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});
/*****************************************************************************************************************************/
workpaper.store.dealPaper.rljxGridFourthStore = function(){
    workpaper.store.dealPaper.rljxGridFourthStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/dealPaper/rljx/grid04.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'id'
        }, [
	        {name: 'id'},
	        {name: 'col1'},
	        {name: 'col2'},	       
	        {name: 'col3'}                    
	       ]
        )
    }); 
};
Ext.extend(workpaper.store.dealPaper.rljxGridFourthStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});
/*################# 工作票办理(结束) ###############################################################################################*/


/*################# 统计查询(起始) ###############################################################################################*/
Ext.namespace('workpaper.store.statQuery');

/******************实时跟踪统计主表对应的store*****************************************************************************************/
workpaper.store.statQuery.trackStatStore = function(){
    workpaper.store.statQuery.trackStatStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/statQuery/trackStat1.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'workUnit'
        }, [
			{name:'workUnit'},
			{name:'filled',type:'int'},
			{name:'sendOut',type:'int'},
			{name:'signIn',type:'int'},
			{name:'executive',type:'int'},
			{name:'permissive',type:'int'},
			{name:'begining',type:'int'},
			{name:'end',type:'int'},
			{name:'mature',type:'int'},
			{name:'deferred',type:'int'},
			{name:'overdue',type:'int'}			                   
	       ]
        )
    });

    //this.setDefaultSort('arriveTime', 'desc');
};
Ext.extend(workpaper.store.statQuery.trackStatStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});

/******************实时跟踪统计——统计表明细对应的store*****************************************************************************************/
workpaper.store.statQuery.trackStatStore_detail = function(){
    workpaper.store.statQuery.trackStatStore_detail.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/statQuery/trackStat2.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'paperId'
        }, [			
			{name:'workUnit'},
	        {name: 'paperId'},
	        {name: 'principal'},	        
	        {name: 'paperType'},
	        {name: 'paperStatus'},
	        {name: 'planTime'},	        
	        {name: 'approver'},	        
	        {name: 'permissionTime'}  		                   
	       ]
        )
    });   
};
Ext.extend(workpaper.store.statQuery.trackStatStore_detail, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});



/******************时段内统计分析主表对应的store*****************************************************************************************/
workpaper.store.statQuery.typeStatStore = function(){
    workpaper.store.statQuery.typeStatStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/statQuery/typeStat1.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'workUnit'
        }, [
			{name:'workUnit'},
			{name:'sbxqd',type:'int'},
			{name:'rljx',type:'int'},
			{name:'rk',type:'int'},
			{name:'dqdy',type:'int'},
			{name:'dqde',type:'int'},
			{name:'ecgzaq',type:'int'},
			{name:'yjdh',type:'int'},
			{name:'ejdh',type:'int'},
			{name:'hj',type:'int'}			                   
	       ]
        )
    });    
};
Ext.extend(workpaper.store.statQuery.typeStatStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});

/******************时段内统计分析——统计表明细对应的store*****************************************************************************************/
workpaper.store.statQuery.typeStatStore_detail = function(){
    workpaper.store.statQuery.typeStatStore_detail.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/statQuery/typeStat2.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'paperId'
        }, [			
			{name:'workUnit'},
	        {name: 'paperId'},
	        {name: 'principal'},	        
	        {name: 'paperType'},
	        {name: 'paperStatus'},
	        {name: 'planTime'},	        
	        {name: 'approver'},	        
	        {name: 'permissionTime'}  		                   
	       ]
        )
    });   
};
Ext.extend(workpaper.store.statQuery.typeStatStore_detail, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});


/******************综合查询对应的store*****************************************************************************************/
workpaper.store.statQuery.queryPaperStore = function(){
    workpaper.store.statQuery.queryPaperStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/statQuery/queryPaper.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'paperId'
        }, [			
	        {name: 'paperId'},	        
	        {name: 'paperType'},
	        {name: 'paperStatus'},
	        {name: 'planTime'},
	        {name: 'principal'},	        
	        {name: 'workDept'},
	        {name: 'workUnit'},	        
	        {name: 'permissiveMan'},
	        {name: 'permissiveTime'},
	        {name: 'sendOutMan'},
	        {name: 'sendOutTime'},
	        {name: 'signInMan'},
	        {name: 'signInTime'},
	        {name: 'fillMan'},
	        {name: 'fillTime'},
	        {name: 'executiveMan'},
	        {name: 'executiveTime'},
	        {name: 'beginingTime'},
	        {name: 'endTime'},
	        {name: 'workers'}	        		                   
	       ]
        )
    });   
};

Ext.extend(workpaper.store.statQuery.queryPaperStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});

/*################# 统计查询(结束) ###############################################################################################*/


/*################# 自定义单例工具类(起始) ###############################################################################################*/
Ext.namespace('workpaper.store.tools');

/******************危险点与控制措施卡模板的选择框对应的store*****************************************************************************************/
workpaper.store.tools.dangersSelStore = function(){
    workpaper.store.tools.dangersSelStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/common/dangersModelGrid.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'id'
        }, [
			{name:'id'},
			{name:'title'},
			{name:'creator'},
			{name:'createTime'}					                   
	       ]
        )
    });
};
Ext.extend(workpaper.store.tools.dangersSelStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});

/******************工作票模板的选择框对应的store*****************************************************************************************/
workpaper.store.tools.paperSelStore = function(){
    workpaper.store.tools.paperSelStore.superclass.constructor.call(this, {
        remoteSort: false,
        url: '../../serverHTML/common/paperModelGrid.html',
        reader: new Ext.data.JsonReader({
            root: 'results',
            totalProperty: 'totalCount',
            id: 'id'
        }, [
			{name:'id'},
			{name:'title'},
			{name:'creator'},
			{name:'createTime'}					                   
	       ]
        )
    });
};
Ext.extend(workpaper.store.tools.paperSelStore, Ext.data.Store, {
    loadForum : function(forumId){
        this.baseParams = {
            forumId: forumId
        };
        this.load({
            params: {
                start:0,
                limit:25
            }
        });
    }
});

/*################# 自定义单例工具类(结束) ###############################################################################################*/

